SaaS with entitlements, usage based billing, meters, overages, spend limits, checkout upsales, customer management...
Long gone are the days of integrating payments in 7 LOCs.
Modern PSPs are like C in programming - stunning low-level abstractions for complete control. But developers deserve a more high-level abstraction focused on iteration velocity.
It's time for the next evolution.
$ cat PAYMENT_INTEGRATION.md
1. Signup 2. Wrangle APIs to map against products/tiers 3. Integrate payment boilerplate 4. Settle for faceless & hosted checkouts 5. Subscribe to countless webhook events 6. Reconcile user state from webhooks 7. Build common entitlements 8. Capture user events and meters separately 9. Develop customer spend limits, upgrade, downgrades. 10. Congratulations. Now... ... handle International Sales Tax, VAT & GST
Understandable fear and complexity around overages, credits and spend limits is holding the ecosystem back from experimenting & innovating on pricing.
We're hell-bent at removing all those headaches and concerns for developers and their customers. Both from a technical and business perspective.
New times deserve new pricing.
Focus ahead:- Unlimited events and meters per product
- Middleware and adapters to automate metering
- Real-time dashboard of events, costs and revenue/customer
- @shadcn-like components for customer forecast & controls
import { Usage } from '@polar-sh/nextjs' import { openai } from '@ai-sdk/openai' import { streamText } from 'ai'; export const POST = Usage() .customer(req => req.headers.get('X-Polar-Customer-Id')) .model(openai('gpt-4o')) .increment('gpt-4o-inputs', ctx => ctx.usage.inputTokens) .increment('gpt-4o-outputs', ctx => ctx.usage.completionTokens) .handler((req, res, model) => { const { prompt }: { prompt: string } = await req.json(); const result = streamText({ model, system: 'You are a helpful assistant.', prompt, }); return result.toDataStreamResponse(); })
We've built an entitlement engine going beyond mere flags to automate granting, revoking and delivering the features themselves depending on billing lifecycles.
Inspired by Passport.js, we're building our SDK/adapters to design for a rich suite of entitlement strategies to cherry-pick and npm, pip or gem install from.
import { Webhooks, Entitlements, EntitlementStrategy } from '@polar-sh/nextjs'; import { WebClient } from '@slack/web-api'; const slackClient = new WebClient(process.env.SLACK_TOKEN); const SlackEntitlement = new EntitlementStrategy() .grant(async ({ customer: { email } }) => slackClient.admin.users.invite({ email })) .revoke(async ctx => slackClient.admin.users.remove(...)); export const POST = Webhooks({ webhookSecret: process.env.POLAR_WEBHOOK_SECRET, entitlements: Entitlements.use('slack', SlackEntitlement) });
We prototype all our features directly in our SDKs and Framework Adapters first. Obsessing over reducing the lines of code, naming and ergonomics.
Our API, Dashboard to Business Operations is designed backwards from there.
Merchant of RecordWe also want you to scale internationally without concerns. So you can leave international tax liabilities to us - we're the Merchant of Record.
import { Checkout } from '@polar-sh/nextjs' export const GET = Checkout({ accessToken: process.env.POLAR_ACCESS_TOKEN, successUrl: process.env.SUCCESS_URL })
All the code powering Polar is available on GitHub under the Apache 2.0 license.
1% OSS ProgramWe're going to make it seamless for developers to automate splitting a portion of their revenue to their open source dependencies.
Inspired by Stripe Climate. Because we need more trees in the physical world and open source software in the binary one.
Polar on GitHub →Polar Community on Discord →$ git clone [email protected]:polarsource/polar.git
Cloning Polar (Apache 2.0)...
From building startups before to Shop.app, Shop Pay and writing the book on FastAPI or React UI engine in Battlefield. Our team is small and battle scared.
Want to build the future of payments for developers? We're looking for a few senior engineers to join the team.
No cover letter needed. Just your best suggestion for how to improve our API, SDK or Framework Adapters is the best conversation starter.
Join Us →The incredible people and early stage firms who have had our back through thick and thin - supporting us from Day 1.